net/designware: add error message on DMA reset timeout
authorAlexey Brodkin <[email protected]>
Tue, 13 Jan 2015 14:10:24 +0000 (17:10 +0300)
committerJoe Hershberger <[email protected]>
Fri, 30 Jan 2015 21:55:00 +0000 (15:55 -0600)
If for some reason DMA module fails to reset user oserves only this:
--->---
# dhcp
Trying dwmac.e0018000
FAIL
--->---

This message makes not much sense.
With proposed change error message will be more helpful:
--->---
# dhcp
Trying dwmac.e0018000
DMA reset timeout
FAIL
--->---

For example user may do power toggle to recover board functionality.

Signed-off-by: Alexey Brodkin <[email protected]>
Cc: Chin Liang See <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Wolfgang Denk <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Marek Vasut <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
Signed-off-by: Joe Hershberger <[email protected]>
drivers/net/designware.c

index 9ded8950b83d22aa6021ed8e81ee4141e6d85a23..c03e935e2fb7df54771bf6222b7ce816c53209b3 100644 (file)
@@ -236,8 +236,10 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 
        start = get_timer(0);
        while (readl(&dma_p->busmode) & DMAMAC_SRST) {
-               if (get_timer(start) >= CONFIG_MACRESET_TIMEOUT)
+               if (get_timer(start) >= CONFIG_MACRESET_TIMEOUT) {
+                       printf("DMA reset timeout\n");
                        return -1;
+               }
 
                mdelay(100);
        };